import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { CaptchaResult, LoginData, LoginResult } from './types';
import qs from 'querystring'
/**
 * 登录API
 *
 * @param data {LoginData}
 * @returns
 */
export function loginApi(data: LoginData): AxiosPromise<LoginResult> {
  return request({
    url: '/connect/token',
    method: 'post',
    headers: { 'content-type': 'application/x-www-form-urlencoded' },
    data:data
  });
}

/**
 * 注销API
 */
export function logoutApi() {
  return request({
    url: '/api/account/logout',
    method: 'get'
  });
}

export function getVerificationCode() {
  return request({
    url: `/api/verification/verification-code`,
    method: 'get'
  })
}



